package com.benjamin.sinamicroblogclient;

import java.util.List;

import com.benjamin.common.AlertUtils;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;

public class MainActivity extends Activity {

	ListView lvStatus;
	List<Status> statusList;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		lvStatus = (ListView) findViewById(R.id.lvStatus);	

		try {
			statusList = new MicroblogUtils().getStatusListUsingJSON(this);
//			statusList = new MicroblogUtils().getStatusList(this);
			StatusListAdapter adapter = new StatusListAdapter(this, statusList);

			lvStatus.setAdapter(adapter);

		} catch (Exception ex) {
			AlertUtils.AlertDialog(this, ex);
		}
	}
}